package cn.kgc.jdktest.demo1;

/**
 * @Author:yaozhaobao
 * @Description:TODO
 * @version:1.0
 */
public class Test {
    public static void main(String[] args) {
        //创建线程对象
        //4-创建Runnable接口的实现类对象
        Runnable runnable = new MyRunnable();

        // 5. 创建Thread对象, 将Runnable接口的实现类对象, 放到Thread的构造方法参数中
        Thread thread = new Thread(runnable);
        Thread thread2 = new Thread(runnable);

        // 6. 调用Thread中的start方法, 开启线程
        thread.start();
        thread2.start();
    }
}
